Method and device for scalable video transcoding

ABSTRACT

The invention relates to a scalable video transcoding method for transcoding an input video signal ( 103 ) coded according to MPEG-2 video standard, resulting in four transcoding architectures. Scalability is obtained by means of to switches ( 120 ) and ( 130 ) determining whether or not reconstruction ( 118 ) and motion compensation ( 128 ) of the coding error ( 119 ) are performed. Each architecture thus defined having a different processing complexity, the overall processing resources available can be optimally used and minimized along a group of frames in the transcoding of parts of said frames in accordance with one of these four architectures, while ensuring a good video quality of tanscoded signal ( 109 ). A cost-effective control strategy of said switches based on an energy prediction of said coding error is also proposed.

[0001] The present invention relates to a method of modifying data in aninput coded video signal for generating an output video signal, eachvideo signal corresponding to a sequence of coded video frames, saidmethod comprising at least:

[0002] an error decoding step for delivering a decoded data signal froma current input coded video frame,

[0003] a re-encoding step for delivering an output video frame carriedby said output video signal from a modified signal, said modified signalresulting from an adding sub-step between a motion-compensated signaland said decoded data signal,

[0004] a reconstruction step for delivering a coding error of saidoutput video frame,

[0005] a motion-compensation step for delivering said motion-compensatedsignal from a stored coding error of a previous output video frame.

[0006] The invention also relates to a transcoding device for carryingout said method. This invention may be used, for instance, in the fieldof video broadcasting.

[0007] Transcoding a coded data signal has become a vital function inthe field of video broadcasting. For instance, when an input videosignal coded according to the MPEG-2 standard has to be broadcast on atransmission channel of limited bandwidth, a transcoding method can beapplied to said input video signal so that the resulting output videosignal has a reduced bitrate that fits within said limited bandwidth.

[0008] A transcoding method is proposed in the European patentapplication EP 0 690 392 A1. This patent application describes a methodand its corresponding device for modifying a coded data signal. Inparticular, this method is used for reducing the bitrate of an inputvideo signal coded according to the MPEG-2 standard.

[0009] It is an object of the invention to provide a method of modifyingdata in a coded data signal which renders it possible to generate amodified video signal with a better rendering quality when a maximumamount of processing resources.

[0010] The prior art method is based on a transcoding architectureincluding a motion compensation branch avoiding a quality drift ontranscoded video frames. This motion compensation branch encompassessaid reconstruction and motion compensation steps. Although leading to ahigh-quality transcoding, this architecture remains complex because themotion compensation branch requires discrete cosine transform (DCT),inverse discrete cosine transform (IDCT), inverse quantization (IQ) andmotion compensation (COMP) steps. Such an architecture is thus dedicatedto video devices having a large amount of processing resources.

[0011] With video devices of limited processing resources, such asconsumer products, therefore, the prior art method cannot beimplemented.

[0012] The motion compensation branch may be suppressed in order todecrease the computational load, leading to the so-called requantizationarchitecture, but this will be to the detriment of the transcoded videosignal quality. In this case, moreover, since the requantizationarchitecture is cost-effective, the processing resources are notoptimally used, i.e. they are not all used.

[0013] To solve the limitations of the prior art method, the method ofmodifying data according to the invention is characterized in that saidmethod comprises:

[0014] a first switching step inserted between said re-encoding step andsaid reconstruction step for activating said reconstruction step,

[0015] a second switching step inserted between said motion-compensationstep and said adding sub-step for activating said motion-compensationstep, said switching steps being controlled independently by a controlstrategy for defining a scalable method defining four architectures formodifying said input coded video signal.

[0016] This method renders it possible to define the following fourtranscoding architectures, which are alternatively activated during thetranscoding of an input video signal:

[0017] requantization architecture: the motion compensation branch issuppressed in the prior art transcoding architecture,

[0018] reconstruction architecture: the motion compensation step issuppressed in the prior art transcoding architecture,

[0019] motion-compensation architecture: the reconstruction step issuppressed in the prior art transcoding architecture,

[0020] high quality architecture: corresponds to the prior arttranscoding architecture.

[0021] In this way the transcoding method becomes scalable because fourarchitectures can be defined. Each architecture thus defined having adifferent processing complexity, the overall processing resourcesavailable can be optimally used in transcoding parts of said input videosignal according to one of this four architectures, without havingunused processing resources as in the prior art method.

[0022] This optimized use of processing resources is based on acost-effective control process which activates said switching steps andallows the system to apply a different transcoding architecture from onemacroblock to another. To this end, the method is characterized in thatthe control strategy of said first switching step, performed at themacroblock level, comprises:

[0023] a first prediction sub-step of the energy of said coding error,said coding error energy being predicted for all re-encoded macroblocksof an output video frame,

[0024] a first selection sub-step for identifying, among macroblocksdefining said coding error, a first set of macroblocks having apredicted coding error energy below a given threshold, the coding errorof said first set of macroblocks being set to a zero value so as toresult in a modified stored coding error,

[0025] a second selection sub-step for identifying, among macroblocksdefining said coding error, a second set of macroblocks having apredicted coding error energy above said given threshold,

[0026] said first switching step activating the reconstruction step forsaid second set of macroblocks.

[0027] The method is also characterized in that the control strategy ofsaid second switching step, performed at the macroblock level,comprises:

[0028] a second prediction sub-step of the energy of saidmotion-compensated signal, said energy being predicted at the macroblocklevel,

[0029] a third selection sub-step for identifying, within saidmotion-compensated signal, a third set of macroblocks having a predictedenergy above said given threshold, said second switching step activatingthe motion-compensation step for each macroblock defining said decodeddata signal, which motion-compensated macroblock belongs to said thirdset of macroblocks.

[0030] This control process can perform motion compensation and/orreconstruction steps only for these macroblocks in the input videosignal which may introduce quality drift in the resulting transcodedoutput video signal.

[0031] This transcoding method and its corresponding transcoding deviceimplementing said method render it possible to obtain a good videoquality of the transcoded signal for a given amount of processingresources.

[0032] Detailed explanations and other aspects of the invention will begiven below.

[0033] The particular aspects of the invention will now be explainedwith reference to the embodiments described hereinafter and consideredin connection with the accompanying drawings, in which identical partsor sub-steps are designated in the same manner:

[0034]FIG. 1 depicts the general embodiment of a transcodingarchitecture according to the invention,

[0035]FIG. 2 depicts the energy prediction of a temporal predictoraccording to the invention,

[0036]FIG. 3 depicts a first transcoding architecture according to theinvention,

[0037]FIG. 4 depicts a second transcoding architecture according to theinvention,

[0038]FIG. 5 depicts a third transcoding architecture according to theinvention,

[0039]FIG. 6 depicts a fourth transcoding architecture according to theinvention,

[0040]FIG. 7 depicts the variation of the number of reconstructedmacroblocks along a GOP.

[0041] The present invention is well adapted to the transcoding ofMPEG-2 input coded video signals, but it will be apparent to thoseskilled in the art that it is applicable to any coded signal encoded bya block-based compression method such as, for example, the one describedin MPEG-4, H.261 or H.263 standards.

[0042] The invention will be described in detail below assuming thatinput and output coded video signals comply with the MPEG-2international video standard (Moving Pictures Experts Group, ISO/IEC13818-2). It is assumed that a video frame is divided into adjacentsquared areas of 16*16 pixels called macroblocks.

[0043]FIG. 1 depicts the general embodiment of a transcoding deviceaccording to the invention. This transcoding device is based on atranscoder arrangement comprising the following functional steps:

[0044] an error decoding step 101 for delivering a decoded data signal102 from a current input coded video signal 103. This step comprises avariable length decoding (VLD) 104 of at least DCT coefficients andmotion vectors contained in signal 103. This step consists in an entropydecoding, e.g. by means of an inverse look-up table of Huffman codes,allowing to obtain decoded DCT coefficients 105 and motion vectors 106.In series with said step 104, an inverse quantization (IQ) 107 isperformed on said decoded coefficients 105 for delivering said decodeddata signal 102. This inverse quantization 107 consists in multiplyingsaid DCT decoded coefficients 105 by a quantization factor contained insaid input signal 103. In most cases this inverse quantization isperformed at the macroblock level because said quantization factor maychange from one macroblock to another. The decoded signal 102 is in thefrequential domain.

[0045] a re-encoding step 108 for delivering an output video signal 109corresponding to the signal resulting from the transcoding of said inputvideo signal 103. Said re-encoding 108 acts on a modified signal 110which results from the addition, by means of the adding sub-step 111, ofsaid decoded data signal 102 to a motion compensated signal 112. Saidre-encoding step 108 comprises in series a quantization (Q) 113. Thisquantization 113 consists in dividing DCT coefficients contained insignal 110 by a new quantization factor for delivering quantized DCTcoefficients 114. This new quantization factor characterizes themodification performed by the transcoding of said input coded videosignal 103, because, for example, a large quantization factor may resultin a bitrate reduction of said input coded video signal 103. In serieswith said quantization 113, a variable length coding (VLC) 115 isapplied to said coefficients 114 for obtaining entropy coded DCTcoefficients 116. Similar to VLD processing, VLC processing consists ina look-up table for associating a Huffman code with each coefficient114. Then coefficients 116 are accumulated in a buffer 117 forconstituting transcoded frames carried by said output video signal 109.

[0046] a reconstruction step 118 for delivering a coding error 119 ofsaid output video signal 109. This reconstruction step renders itpossible to quantify the coding error introduced by the quantization113. As will be explained in a following paragraph, such a coding errorof a current transcoded video frame can be taken into account for thetranscoding of the next video frame for avoiding a quality drift in theoutput video signal 109. This reconstruction step is connected to saidre-encoding step 108 by a first switching step 120. Said first switchingstep 120 isolates said reconstruction step 118 from said re-encodingstep 108 if the switch is open, or enables the reconstruction of acoding error if the switch is closed. This first switching step iscontrolled by a control process 121, for selecting the open or closemode, as will be explained in a following paragraph. If said firstswitching step is closed, signals 110 and 114 are simultaneously sent tosaid reconstruction step 118. In that case an inverse quantization (IQ)122 is performed on said signal 114, resulting in signal 123. Asubtraction sub-step 124 is then performed between signal 110 and signal123. The resulting signal 125 corresponds to said coding error, in thefrequency domain, caused by the quantization 113. An IDCT step 126 isthen performed on said signal 125 for obtaining said coding error 119 inthe pixel domain. To illustrate said reconstruction step 118 performedat the macroblock level, a current macroblock carried by signal 110results after transcoding in a modified macroblock carried by signal114, the loss of quality of said modified macroblock being quantified bya coding error macroblock carried by signal 119. During the transcodingof an input current video frame, if the reconstruction of a macroblockis activated, the resulting coding error 119 is stored in memory 127 inorder to be used during the transcoding of the next input video frame.Otherwise, the coding error of macroblocks for which no reconstructionis performed is set to a zero value and stored in said memory 127.

[0047] a motion-compensation step 128 for delivering saidmotion-compensated signal 112 from a stored coding error 129 relative tothe previous transcoded video frame. This motion-compensation step 128is connected to said adding sub-step 111 by a second switching step 130.Said second switching step 130 isolates said motion compensation step128 from said adding sub-step 111 if the switch is open, or releases themotion-compensation of a coding error if the switch is closed. Thissecond switching step is controlled by a control process 131, allowing,as explained in a following paragraph, the system to select the open orclose mode. If said second switching step is closed, signal 112 is sentto said adding sub-step 111. In that case a motion-compensation 132 isperformed on the basis of said stored coding error 129, using motionvectors 106. Such a motion compensation 132 being performed in the pixeldomain, the resulting pixel-based motion-compensated signal 133 ispassed through a DCT step 134 so that the resulting frequentialmotion-compensated signal 112 can be added to said decoded data signal102.

[0048] Four transcoding architectures can thus be derived from thisgeneral architecture described above by means of the two switching steps120 and 130:

[0049] requantization architecture,

[0050] reconstruction architecture,

[0051] motion-compensation architecture,

[0052] high-quality architecture.

[0053] A scalable transcoding method is thus obtained which renders itpossible to apply one of these four architectures to a given macroblockto be transcoded, in taking into account not only criteria for obtainingthe best video quality of the transcoded macroblocks, but also criteriafor minimizing the computational load.

[0054] The reconstruction switch strategy 121 is based on acost-effective prediction, without reconstruction, of the coding errorenergy of each transcoded macroblock. Indeed, since the energy of saidcoding error represents the amount of degradation imposed on the inputvideo signal by the transcoding, it is a relevant criterion fordetecting macroblocks which will require reconstruction, so that thiscoding error will not propagate over macroblocks in the subsequenttranscoded frames, whereby a quality drift is avoided.

[0055] The principle of said reconstruction switch strategy 121,accordingly, is to reconstruct only coding error macroblocks having ahigh energy.

[0056] Let us adopt the following notations:

[0057] M_(max) is the number of macroblocks in a video frame,

[0058] NB_(recon) is the number of reconstructed macroblocks in atranscoded video frame,

[0059] i is the rank of a macroblock in a video frame verifying1<I<M_(max), (i implicitly refers to a couple of horizontal and verticalindices in said video frame),

[0060] X_(i) refers to coefficients defining a macroblock having rank icarried by signal 110,

[0061] Y_(i) refers to coefficients defining a macroblock having rank icarried by signal 114,

[0062] YDQ_(i) refers to coefficients defining a macroblock having ranki carried by signal 123,

[0063] z_(i) refers to coefficients defining a macroblock having rank icarried by signal 119,

[0064] Z_(i) refers to coefficients defining a macroblock having rank icarried by signal 125,

[0065] IQ(s) is the inverse quantized signal of signal s,

[0066] Ê(s) is the predicted energy of signal s,

[0067] E(s) is the energy of signal s,

[0068] Q_(out) is the quantization factor used in step 113.

[0069] The coding error energy of a given macroblock z_(i) is predictedas follows. The Parseval theorem, indicating that the energy of a signalis the same in the frequential domain as in the pixel domain, impliesthat it can be written:

E(z _(i))=E(Z _(i))  Eq.1

E(z _(i))=E(X _(i) −YDQ _(i))

E(z _(i))=E(X _(i) −IQ(Y _(i)))

[0070] According to the MPEG-2 video standard, it can be written:

IQ(Y _(i))=(2*Y _(i) +k)*W _(i) *Q _(out)/32  Eq.2

[0071] where W_(i) is a weighted matrix and $k = \left\{ \begin{matrix}0 & {{fo}\quad r\quad {INTRA}\quad {macroblocks}} \\{s\quad i\quad g\quad {n\left( Y_{i} \right)}} & {{for}\quad {non}\text{-}{INTRA}\quad {macroblocks}}\end{matrix} \right.$

[0072] If k is set to 0, and W_(i) is set to 16 (i.e. a flat matrix),said coding error prediction Ê(z_(i)) can be evaluated according to thefollowing equation:

Ê(z _(i))=E(X _(i) −Y _(i) ×Q _(out))  Eq.3

[0073] This energy prediction is cost-effective because the IDCT step126 and the IQ step 122 are not performed.

[0074] Considering a current transcoded video frame, an energyprediction according to Eq. 3 is first performed on all transcodedmacroblocks in said current video frame. In this way a set of M_(max)predicted coding error energy values is obtained. This set of predictedcoding error energies are sorted in an increasing order for determininga first set of macroblocks having a predicted coding error energy belowa given threshold Ec and a second set of macroblocks having a predictedcoding error energy above said given threshold Ec. The reconstructionstep is then performed, by closing said switch 120, only on said secondset of macroblocks comprising NB_(recon) macroblocks. The resultingreconstructed macroblocks, carried by signal 119, are then stored inmemory 127. In parallel, the ranks and predicted coding energies ofreconstructed macroblocks are stored in an auxiliary memory.

[0075] Said energy threshold Ee may be set to a fixed value, leading toa varying number of reconstructed macroblocks NB_(recon) from frame toframe. Said threshold may also be determined so as to take into accountthe processing resources available on the transcoding platform. Thus, itcan be decided not to reconstruct more than a given percentage P ofmacroblocks in any frame, with P=100*NB_(recon)/M_(max1). In this lastcase, the energy threshold Ec corresponds to the energy of themacroblock in said second set having the lowest energy.

[0076] Since macroblocks of said first set are supposed to have a smallcoding error, the reconstruction is not performed for these macroblocks(switch 121 open) in a next step, and their coding error is set to azero value. Ranks of non-reconstructed macroblocks are stored in saidauxiliary memory, as were reconstructed macroblocks In contrast to acoding error obtained after a reconstruction performed on allmacroblocks of a current frame, a modified coding error stored in memory127 is obtained in that only a reconstruction is performed for saidsecond set of macroblocks and said first set of macroblocks is set to azero value. Note that this stored modified coding error is used for aquality drift correction not during the transcoding of said currentframe, but during the transcoding of the next frame.

[0077] The motion-compensation switching strategy 131 is based on acost-effective energy prediction of the temporal predictor macroblockcarried by signal 112 of each macroblock carried by signal 102 for whicha motion-compensation can be performed. Of course, thismotion-compensation does not relate to video frames coded according toan INTRA mode, but only to video frames coded according to a previousframe, e.g. P and B modes. The energy of said temporal predictor, alsocalled motion-compensated macroblock, is a relevant criterion fordetecting macroblocks carried by signal 102 that may introduce qualitydrift if no motion-compensation is performed during their transcoding.

[0078] The principle of said motion compensation switching strategy 131is to perform motion-compensation for input macroblocks carried bysignal 102 for which the energy of their temporal predictor is high.

[0079] As is depicted in FIG. 2, the temporal predictor is themacroblock PRED pointed by motion vector 106 representing said modifiedstored coding error, said macroblock PRED overlapping four adjacentmacroblocks in the general case. Such a motion vector, associated withan input macroblock carried by signal 102 for which a transcoding isexpected, renders it possible to retrieve indices of macroblocksoverlapped by said macroblock PRED, and thus to retrieve their storedpredicted coding error energy Ê_(i). The predicted energy Êmc_(i) ofsaid temporal predictor macroblock is determined from a weighted averageof the predicted coding error energies Ê_(i) relative to said fourmacroblocks stored in said auxiliary memory, according to the equation:$\begin{matrix}{{\hat{E}\quad m\quad c_{i}} = {K*\frac{\begin{matrix}{{h\quad 1*v\quad 1*{\hat{E}}_{1}} + {\left( {16 - {h\quad 1}} \right)*v\quad 1*{\hat{E}}_{2}} + {h\quad 1*\left( {16 - {v\quad 1}} \right)*}} \\{{\hat{E}}_{3} + {\left( {16 - {v\quad 1}} \right)*\left( {16 - {v\quad 1}} \right)*{\hat{E}}_{4}}}\end{matrix}}{16*16}}} & {{Eq}.\quad 4}\end{matrix}$

[0080] with K a correcting factor talking into account the pixelinterpolation performed on said four adjacent macrobloclcs, for motionvectors 106 having {fraction (1/2)} pixel coordinates,

[0081] with v1 and h1 the number of pixels of macroblock having rank 1overlapped by macroblock PRED.

[0082] A calculation of Êmc_(i) is thus performed for each non-INTRAinput macroblock i carried by signal 102. This predicted value is thencompared with said energy threshold Ec. If Êmc_(i)<Ec, the switch 130remains open during the transcoding of said input macroblock, so thatthe motion compensation is not performed. If Êmc_(i)>Ec, however, theswitch 130 remains closed during the transcoding of said inputmacroblock, so that the motion-compensation is performed, avoiding thequality drift so as to ensure a good quality of the resulting transcodedmacroblocks carried by signal 114 (and 109).

[0083] According to the invention, many energy calculations can beperformed. For example, energy calculation may be based on the standardL2, also known as quadratic energy, applied to the set of valuesdefining the macroblock for which an energy prediction is expected(frequency-or pixel-based values). Similarly, such a calculation mayalso be performed in using standard L1, which requires less processingmeans.

[0084]FIG. 3 corresponds to the requantization architecture derived fromthe general transcoding architecture depicted in FIG. 1 according to theinvention.

[0085] This is the less expensive architecture because an input currentmacroblock carried by signal 102 is neither reconstructed normotion-compensated. As a consequence, the transcoding consists in adecoding 101 followed by a re-encoding 108. Such an architecture isdefined through opening of switches 120 and 130, said switches beingcontrolled in accordance with the strategy described above. Althoughthis architecture will generally introduce major loss of quality intranscoded macroblocks, no loss of quality is expected in its use in thecontext of the invention because it is only performed on input targetedmacroblocks having a low predicted coding error energy and a lowtemporal predictor energy.

[0086]FIG. 4 corresponds to the reconstruction architecture derived fromthe general transcoding architecture depicted in FIG. 1 according to theinvention.

[0087] As in the requantization architecture, the transcoding of aninput current macroblock consists in a decoding 101 followed by are-encoding 108. Such an architecture is defined through closing ofswitch 120 in opening of switch 130, said switches being controlled inaccordance with the strategy described above. The same video quality asthe one obtained with the requantization architecture is expected forthe transcoded macroblocks. Transcoded macroblocks having a highpredicted coding error energy are reconstructed and stored in memory 127so that they may be used as temporal predictors during the transcodingof macroblocks of the next input video frame.

[0088]FIG. 5 corresponds to the motion-compensation architecture derivedfrom the general transcoding architecture depicted in FIG. 1 accordingto the invention.

[0089] The transcoding of an input current macroblock consists in adecoding 101, which results in the decoded data signal 102, which isadded to the motion compensated signal 112 resulting from the motioncompensation 128. Such an architecture is defined through opening ofswitch 120 and closing of switch 130, said switches being controlled inaccordance with the strategy described above. The motion compensation128, performed on stored coding error macroblocks of the previoustranscoded video frame, avoids quality drift so that a constant videoquality of transcoded frames is obtained from one frame to the next inthe output video signal 109.

[0090]FIG. 6 corresponds to the high-quality architecture derived fromthe general transcoding architecture depicted in FIG. 1 according to theinvention.

[0091] As in the motion-compensation architecture, the transcoding of aninput current macroblock consists in a decoding 101 which results in thedecoded data signal 102 which is added to the motion-compensated signal112 resulting from the motion compensation 128. Such an architecture isdefined through closing of the switches 120 and 130, said switches beingcontrolled in accordance with the strategy described above. The motioncompensation 128, performed on stored coding error macroblocks of theprevious transcoded video frame, avoids quality drift so that a constantvideo quality of transcoded frames is obtained from one frame to thenext in the output video signal 109. At the same time, any coding errorrelative to transcoded macroblocks is reconstructed and stored in viewof possible future use by the motion compensation during the transcodingof the next input video frame.

[0092] As was noted above, setting the number NB_(recon) ofreconstructed coding error macroblocks per frame renders it possible todefine an energy threshold Ec, the motion compensation being onlyperformed for input macroblocks whose temporal predictors have apredicted energy above said energy threshold.

[0093] If Ec has a very low value, most coding error macroblocks will bereconstructed, and most input macroblocks will be motion-compensated,leading to a high quality of transcoded frames but to an expensivesolution. By contrast, if Ec has a high value, most coding errormacroblocks will not be reconstructed, and most input macroblocks willnot be motion-compensated, leading to a poor quality of transcodedframes but to an expensive solution.

[0094] A method of obtaining the best compromise between cost andquality is then proposed. It takes into account that the quantizationerror caused by step 113 propagates from frame to frame inside a GOP(Group Of Pictures) if coding error macroblocks are neitherreconstructed nor motion-compensated. This error propagation inside aGOP is exacerbated by P and B frames (i.e. temporally predicted frames),but stops at each beginning of a new GOP (i.e. on an INTRA frame).Moreover, the first temporally predicted frame inside a GOP which servesas a temporal reference for the following temporally predicted frames ismore important than the last frames, because here the error propagationwill spread over a smaller number of frames. Thus the number NB_(recon)can be correlated to the frame position inside a GOP such thatNB_(recon) has a decreasing value along a GOP, while keeping an averagenumber of reconstructed macroblocks with in the range of what is allowedfor the processing resources.

[0095] The variation of NB_(recon) along a GOP comprising 12 frames (oneINTRA frame followed by eleven temporally predicted frames) is depictedin FIG. 7. This number varies from a maximum NB_(max) for the firstframe, to a minimum NB_(min) for the last frame. In this way moremacroblocks are reconstructed at the beginning of a GOP for the purposeof ensuring a good quality of the next transcoded frames throughactivation of the motion compensation. Fewer macroblocks arereconstructed, however, at the end of a GOP, for the purpose of reducingthe computational load as much as possible, but without significant lossof quality. Thus, a good and constant quality is obtained along a GOPwhile the processing resources are optimally utilized.

[0096] In a particular embodiment of the invention, the switches 120 and130 are implemented at the frame level instead of at the macroblocklevel. In this case, the overall macroblocks of a given input frame aretranscoded in accordance with one of the four described transcodingarchitectures. Although this strategy leads to a coarser scalabilitylevel, it is a cost-effective solution since control strategies 121 and131 only have to update the switching steps 120 and 130 at the beginningof each frame.

[0097] This scalable method of transcoding an input coded video signalmay be implemented in several manners in a transcoding device. Thetranscoding device may correspond to broadcasting equipment forperforming a bitrate change on an MPEG-2 coded video signal, but mayalternatively correspond to a consumer product such as a set-top box ora DVD (Digital Video Disc), where a bitrate change is performed forstoring or recopying an MPEG-2 coded video signal.

[0098] From a material point of view, this scalable method may beimplemented by means of wired electronic circuits or, alternatively, bymeans of a set of instructions stored in a computer-readable medium,said instructions replacing at least a portion of said circuits andbeing executable under the control of a computer or a digital processorin order to carry out the same functions as fulfilled in said replacedcircuits. The invention then also relates to a computer-readable mediumcomprising a software module which includes computer-executableinstructions for performing the steps, or some steps, of the methoddescribed above.

[0099] According to the invention, an optimization of the memory space127 is proposed. It consists in storing in said memory onlyreconstructed coding error macroblocks, and not coding error macroblocksforced to a zero value. Said memory may thus be proportioned for storingonly NB_(max) reconstructed macroblocks, which represents a substantialgain compared with a memory space proportioned for receiving M_(max)macroblocks.

1. A method of modifying data in an input coded video signal forgenerating an output video signal, each video signal corresponding to asequence of coded video frames, said method comprising at least: anerror decoding step for delivering a decoded data signal from a currentinput coded video frame, a re-encoding step for delivering an outputvideo frame, carried by said output video signal, from a modifiedsignal, said modified signal resulting from an adding sub-step between amotion-compensated signal and said decoded data signal, a reconstructionstep for delivering a coding error of said output video frame, amotion-compensation step for delivering said motion-compensated signalfrom a stored coding error of a previous output video frame,characterized in that said method comprises: a first switching stepinserted between said re-encoding step and said reconstruction step foractivating said reconstruction step, a second switching step insertedbetween said motion-compensation step and said adding sub-step foractivating said motion-compensation step, said switching steps beingcontrolled independently by a control strategy for defining a scalablemethod defining four architectures for modifying said input coded videosignal.
 2. A method of modifying data as claimed in claim 1,characterized in that the control strategy of said first switching step,performed at the macroblock level, comprises: a first predictionsub-step of the energy of said coding error, said coding error energybeing predicted for all re-encoded macroblocks of an output video frame,a first selection sub-step for identifying, among macroblocks definingsaid coding error, a first set of macroblocks having a predicted codingerror energy below a given threshold, the coding error of said first setof macroblocks being set to a zero value so as to result in a modifiedstored coding error, a second selection sub-step for identifying, amongmacroblocks defining said coding error, a second set of macroblockshaving a predicted coding error energy above said given threshold, saidfirst switching step activating the reconstruction step for said secondset of macroblocks.
 3. A method of modifying data as claimed in claim 2,characterized in that the control strategy of said second switchingstep, performed at the macroblock level, comprises: a second predictionsub-step of the energy of said motion-compensated signal, said energybeing predicted at the macroblock level, a third selection sub-step foridentifying, within said motion-compensated signal, a third set ofmacroblocks having a predicted energy above said given threshold, saidsecond switching step activating the motion-compensation step for eachmacroblock defining said decoded data signal, which motion-compensatedmacroblock belongs to said third set of macroblocks.
 4. A method ofmodifying data as claimed in claim 2, characterized in that the firstprediction sub-step of the energy of said coding error consists in anenergy calculation of a signal obtained after subtraction of said outputvideo signal multiplied by a quantization factor from said modifiedsignal.
 5. A method of modifying data as claimed in claim 3,characterized in that the second prediction sub-step of the energy ofsaid motion-compensated signal consists in a weighted average of fourpreviously predicted coding error energy values relating to fouradjacent macroblocks which define said modified coding error.
 6. Amethod of modifying data as claimed in claim 3, characterized in thatthe motion-compensation step, when activated by said second switchingstep, is performed on the basis of said modified stored coding error. 7.A method of modifying data as claimed in claim 1, characterized in thatthe first switching step is activated so as to obtain a decreasingnumber of reconstructed macroblocks over a GOP.
 8. A method of modifyingdata as claimed in claim 1, characterized in that the switching stepsare controlled at the frame level, a given input coded video frame beingmodified in accordance with one of said four architectures.
 9. Atranscoding device for modifying data in an input coded video signal forgenerating an output video signal, each video signal corresponding to asequence of coded video frames, said device comprising at least:decoding means for delivering a decoded data signal from a current inputcoded video frame, re-encoding means for delivering an output videoframe, carried by said output video signal, from a modified signal, saidmodified signal resulting from addition means adding amotion-compensated signal to said decoded data signal, reconstructionmeans for delivering a coding error of said output video frame,motion-compensation means for delivering said motion-compensated signalon the basis of a stored coding en-or of a previous output video frame,characterized in that said transcoding device comprises: first switchingmeans inserted between said re-encoding means and said reconstructionmeans for activating said reconstruction means, second switching meansinserted between said motion-compensation means and said addition meansfor activating said motion-compensation means, said switching meansbeing controlled independently by control means for defining a scalabletranscoding device defining four architectures for modifying said inputcoded video frames.
 10. A transcoding device for modifying data asclaimed in claim 9, characterized in that the control means of saidfirst switching means comprise: first prediction means for predictingthe energy of said coding error, said coding error energy beingpredicted for all re-encoded macroblocks of an output video frame, firstselection means for identifying, among macroblocks defining said codingerror, a first set of macroblocks having a predicted coding error energybelow a given threshold, the coding error of said first set ofmacroblocks being set to a zero value so as to result in a modifiedstored coding error, second selection means for identifying, amongmacroblocks defining said coding error, a second set of macroblockshaving a predicted coding error energy above said given threshold, saidfirst switching means activating the reconstruction means for saidsecond set of macroblocks.
 11. A transcoding device for modifying dataas claimed in claim 10, characterized in that the control means of saidsecond switching means comprise: second prediction means for predictingthe energy of said motion-compensated signal, said energy beingpredicted at the macroblock level, third selection means foridentifying, within said motion-compensated signal, a third set ofmacroblocks having a predicted energy above said given threshold, saidsecond switching means activating motion compensation means for eachmacroblock defining said decoded data signal, which motion-compensatedmacroblock belongs to said third set of macroblocks.
 12. A transcodingdevice for modifying data as claimed in claim 10, characterized in thatsaid modified coding error is stored in a memory whose capacity isproportioned for storing only reconstructed macroblocks.
 13. A set-topbox product for modifying data in an input coded video coded accordingto the MPEG-2 video standard, said set-top box product implementingsteps and sub-steps of the method as claimed in claims 1 to
 8. 14. Acomputer program product for a transcoding device for modifying data ina coded video signal, which product comprises a set of instructionswhich, when loaded into said device, causes said device to carry out anymethod as claimed in claims 1 to 8.